// * 请求响应参数(不包含data)
export interface Result {
	code: number;
	message: string;
	success: boolean;
}
// * 请求响应参数(包含data)
export interface ResultData<T = any> extends Result {
	result: T;
}
export interface ReqBase {
	id: string;
	ids?: string | string[];
}

// * 分页响应参数
export interface ResPage<T> {
	datalist: T[];
	pageIndex: number;
	pageSize: number;
	total: number;
	records?: any;
}

// * 分页请求参数
export interface ReqPage {
	[key: string]: any;
	pageIndex: number;
	pageSize: number;
}

// * 文件上传模块
export namespace Upload {
	export interface ResFileUrl {
		fileUrl: string;
	}
}

// * 登录模块
export namespace Login {
	export interface ReqLoginForm {
		username?: string;
		password?: string;
		rememberUser?: boolean;
		phone?: string;
		code?: string;
		qrCode?: string;
	}
	export interface ResLogin {
		expire: string;
		token: string;
		user: any;
	}
}
// * 菜单按钮权限
export namespace AuthButtons {
	export interface ReqAuthButtons {
		parentId?: string;
		type?: string;
		sort?: string;
		order?: boolean;
		enable?: number;
	}
	export interface ResAuthButtons {
		records: { children: any };
	}
}
// * 角色管理模块
export namespace Role {
	export interface ResRoleList {
		id: string;
		username: string;
		gender: string;
		user: {
			detail: {
				age: number;
			};
		};
		idCard: string;
		email: string;
		address: string;
		createTime: string;
		status: number;
		avatar: string;
		children?: ResRoleList[];
		roleId: string;
		roleName: string;
	}
}
// * 分组管理模块
export namespace Dept {
	export interface DeptRows {
		records: { children: ResDeptList[] };
	}
	export interface ResDeptList {
		address: string;
		createTime: string;
		creator: string;
		creatorId: string;
		deptExtend: string;
		deptId: string;
		deptInfo: any;
		deptName: string;
		description: string;
		hasChildren: boolean;
		id: string;
		isboot: string;
		key: number;
		leaf: boolean;
		locLatitude: number;
		locLongitude: number;
		modifyTime: string;
		orderNum: number;
		parentId: string;
		parentName: string;
		personLiable: string;
		tel: string;
		text: string;
		title: string;
		type: string;
	}
}
// * 用户管理模块
export namespace User {
	export interface ReqUserParams extends ReqPage {
		username: string;
		gender: number;
		idCard: string;
		email: string;
		address: string;
		createTime: string[];
		status: number;
	}
	export interface ReqUserRegister {
		username: string;
		password: string;
		mobile: string;
		email: string;
		code: string;
		company: string;
	}
	export interface ResUserList {
		id: string;
		createTime: string;
		creator: string;
		creatorId: string;
		email: string;
		lastLoginTime: string;
		mobile: string;
		modifyTime: string;
		password: string;
		roleId: string;
		roleName: string;
		ssex: string;
		status: string;
		username: string;
		deptIdList: any;
		deptIds: string;
		deptName: string;
	}
	export interface ResStatus {
		userLabel: string;
		userValue: number;
	}
	export interface ResGender {
		genderLabel: string;
		genderValue: number;
	}
	export interface ResDepartment {
		id: string;
		name: string;
		children?: ResDepartment[];
	}
	export interface ResRole {
		id: string;
		name: string;
		children?: ResDepartment[];
	}
}
